/* ==========================================================================
   YourSwissPC — Configurateur produit
   Thème : clair, sobre, orienté "fiche technique" — inspiré des
   configurateurs pro (LDLC, PCSpecialist, Alternate) : fond neutre,
   listes de composants en lignes, un seul accent utilisé avec parcimonie
   (repris du violet déjà présent dans le header, pas de couleur inventée).
   ========================================================================== */

:root {
  --bg: #f4f4f6;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --border: #e2e3e6;
  --border-strong: #cfd1d6;

  --text: #1b1c20;
  --text-muted: #6b6e75;
  --text-faint: #9a9da3;

  --accent: #540886;
  --accent-soft: rgba(84, 8, 134, 0.06);
  --accent-soft-strong: rgba(84, 8, 134, 0.1);

  --radius-lg: 10px;
  --radius-md: 8px;
  --radius-sm: 5px;

  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
}

html,
body {
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  -ms-overflow-style: none;
  scrollbar-width: none;
  background-color: var(--bg);
  font-family: var(--font-body);
  color: var(--text);
}

/* ==========================================================================
   HEADER — inchangé (structure/logique), couleurs d'origine conservées.
   ========================================================================== */

.header-left { flex: 1; display: flex; align-items: center; }
.header-center { flex: 2; display: flex; justify-content: center; align-items: center; }
.header-right { flex: 1; display: flex; justify-content: flex-end; align-items: center; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 160px;
  padding: 0 3rem;
  background-color: #121212;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  font-family: var(--font-body);
}

.logo-img { height: 80%; object-fit: contain; max-height: 120px; margin-bottom: 1rem; }

.nav-links { list-style: none; display: flex; gap: 2rem; }
.nav-links a { color: white; text-decoration: none; font-size: 1.2rem; transition: color 0.3s ease; }
.nav-links a:hover { color: #c9a3e0; }

.login-button {
  padding: 0.6rem 1.2rem;
  background-color: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background-color 0.3s ease;
  width: auto;
}
.login-button:hover { background-color: #6d0ea8; }

/* ==========================================================================
   Sélecteur de plateforme (autres pages réutilisant cette feuille) —
   non concerné par cette refonte, laissé tel quel.
   ========================================================================== */
.platform-section { margin-top: 1rem; }
.intro-text { font-size: 1.2rem; margin-bottom: 1rem; }
.platform-buttons { display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; }
.platform-btn-amd {
  background-color: #9b0000; color: #fff; border: none; border-radius: 12px;
  padding: 1rem 2rem; font-size: 1.2rem; cursor: pointer; transition: all 0.3s ease;
  text-decoration: none; display: inline-block;
}
.platform-btn-intel {
  background-color: #0559cf; color: #fff; border: none; border-radius: 12px;
  padding: 1rem 2rem; font-size: 1.2rem; cursor: pointer; transition: all 0.3s ease;
  text-decoration: none; display: inline-block;
}
.platform-btn-amd:hover { transform: translateY(-2px); }
.platform-btn-intel:hover { transform: translateY(-2px); }

/* ==========================================================================
   PAGE PRODUIT
   ========================================================================== */

.product-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.breadcrumb { font-size: 0.85rem; margin-bottom: 1.25rem; color: var(--text-faint); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

.product-container {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "images config"
    "price  config";
  column-gap: 2rem;
  row-gap: 1rem;
}

/* ---------------- Colonne image ---------------- */
.product-images {
  grid-area: images;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gallery-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
}

.product-images img {
  width: 100%;
  max-width: 340px;
  border-radius: var(--radius-md);
  transition: opacity 0.4s ease;
}

.slider-arrows {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 0.85rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.arrow {
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.arrow:hover { color: var(--accent); border-color: var(--accent); }

.trust-badges {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.3rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.trust-badges li { list-style: none; display: flex; align-items: baseline; gap: 0.55rem; }
.trust-badges li::before {
  content: "—";
  color: var(--text-faint);
  flex: none;
}

/* ---------------- Colonne configuration ---------------- */
.product-config { grid-area: config; min-width: 0; }

.product-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-strong);
}

.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.product-header h1 {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text);
}

#options-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* --- Cartes de catégorie (option-group) --- */
.option-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.3rem 0.4rem;
  margin-bottom: 0 !important; /* neutralise le style inline ajouté par le JS */
}

.cat-label {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.cat-label-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: var(--text-faint);
  flex: none;
}
.cat-icon svg { width: 100%; height: 100%; }

.series-selector {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.series-selector select {
  margin-left: 0.4rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
}

/* --- Liste des options : lignes empilées, pas de grille de pastilles ---
   Le JS applique un style inline display:flex/justify-content:center à
   TOUT div enfant de .option-group : on le neutralise avec !important
   pour garder un empilement vertical, sans toucher au script. */
.option-buttons {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  border-top: 1px solid var(--border);
}

.option-btn {
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid transparent;
  padding: 0.7rem 0.6rem 0.7rem 0.55rem;
  color: var(--text);
  font-size: 0.87rem;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.option-btn::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  margin-right: 0.7rem;
  flex: none;
}

.option-btn:hover:not(.active):not(.unavailable):not(:disabled) {
  background-color: var(--surface-2);
}

.option-btn.active {
  background-color: var(--accent-soft);
  border-left-color: var(--accent);
  font-weight: 600;
}

.option-btn.active::before {
  background: var(--accent);
  border-color: var(--accent);
}

.option-btn.unavailable,
.option-btn:disabled {
  color: var(--text-faint);
  cursor: not-allowed;
}
.option-btn.unavailable .opt-label,
.option-btn:disabled .opt-label {
  text-decoration: line-through;
}

.option-btn.hidden { display: none !important; }

.opt-label { flex: 1; }

.opt-delta {
  flex: none;
  margin-left: 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.option-btn.active .opt-delta { color: var(--accent); }

/* Longues listes (ex. processeur) : hauteur limitée + défilement, pour
   éviter le mur d'options tout en gardant chaque ligne lisible. */
.option-group[data-group="cpu"] .option-buttons,
.option-group[data-group="watercooling"] .option-buttons {
  max-height: 258px;
  overflow-y: auto;
}

/* ==========================================================================
   DESCRIPTION & SPECS
   ========================================================================== */
.product-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 0.4rem 0 0.5rem;
}

.product-description,
.product-specs {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.5rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: left;
}
.product-description p:first-child { color: var(--text); }

.product-specs h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.8rem;
}
.product-specs ul { list-style: none; padding-left: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.product-specs li { font-size: 0.85rem; display: flex; align-items: baseline; gap: 0.55rem; }
.product-specs li::before { content: "—"; color: var(--text-faint); }

.footnote { font-size: 0.8rem; color: var(--text-faint); }
.note { color: var(--text-muted); }

/* ==========================================================================
   PETIT ENCADRÉ PRIX — sous les infos rapides (Windows 11, SSD reformaté...).
   Positionné comme 3e frère du conteneur (pas imbriqué dans .product-images)
   pour pouvoir rester "sticky" sur toute la hauteur du scroll, colonne
   configurateur comprise — sur desktop ET sur mobile.
   ========================================================================== */
.price-card {
  grid-area: price;
  align-self: start;
  position: sticky;
  top: 185px;

  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.price-card__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.price-card__name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.price {
  font-family: var(--font-body);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

.price-card__actions {
  display: flex;
  gap: 0.5rem;
}

.btn-validate-config,
.btn-add-to-cart {
  flex: 1;
  text-align: center;
}

.btn-validate-config {
  font-family: var(--font-body);
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-validate-config:hover { border-color: var(--text-muted); color: var(--text); }

.btn-add-to-cart {
  font-family: var(--font-body);
  background-color: var(--accent);
  color: #fff;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-add-to-cart:hover { background-color: #6d0ea8; border-color: #6d0ea8; }

.config-confirmation {
  display: none;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.8rem;
  font-size: 0.76rem;
  line-height: 1.4;
  color: var(--text);
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
  .site-header { flex-direction: column; height: auto; text-align: center; padding: 1rem; }
  .logo-img { max-height: 120px; margin-bottom: 1rem; }
  .nav-links { flex-wrap: wrap; justify-content: center; gap: 1rem; }
  .header-right { margin-top: 1rem; }
  .product-container { display: flex; flex-direction: column; gap: 1.25rem; }
  .price-card { top: 100px; }
  .product-content { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  body { font-size: 0.9rem; }
  .site-header { height: 80px; padding: 0 1rem; overflow: visible; position: relative; }
  .logo-img { max-height: 400px; height: auto; margin-top: -160px; display: block; margin-left: auto; margin-right: auto; }
  .nav-links { flex-direction: column; gap: 0.5rem; }
  .product-page { padding: 1rem 1rem 2rem; }
  .product-header h1 { font-size: 1.4rem; }
  .price-card { top: 90px; }
  .slider-arrows { font-size: 1rem; }
}

/* ======== MENU BURGER (logique/markup inchangés) ======== */
.menu-toggle { display: none; flex-direction: column; justify-content: space-between; width: 28px; height: 20px; cursor: pointer; }
.menu-toggle span { display: block; height: 3px; background-color: white; border-radius: 5px; transition: 0.3s ease; }
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

@media (max-width: 900px) {
  .site-header { flex-direction: column; align-items: center; justify-content: center; text-align: center; height: auto; padding: 1rem; position: relative; }
  .logo-img { max-width: 300px; height: auto; margin: 10px auto; }
  .menu-toggle { display: flex; position: absolute; right: 20px; top: 25px; z-index: 1000; cursor: pointer; }
  .header-center { width: 100%; }
  .nav-links { display: none; flex-wrap: wrap; justify-content: center; background-color: #121212; width: 100%; text-align: center; padding: 1rem 0; border-top: 1px solid #333; gap: 1rem; }
  .nav-links.show { display: flex; }
  .nav-links li { flex: 1 1 28%; min-width: 100px; }
  .nav-links a { display: inline-block; width: 100%; background-color: #1e1e1e; color: white; text-decoration: none; font-size: 0.95rem; padding: 0.8rem 0; border-radius: 8px; transition: background-color 0.3s ease; }
  .nav-links a:hover { background-color: var(--accent); }
  .header-right { display: none; margin-top: 1rem; }
}
